home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 026a / fifo.zip / README.TXT < prev    next >
Text File  |  1991-03-04  |  3KB  |  55 lines

  1. This is a procedure (trangain) which computes the realized gain for an
  2. investment account using "First In - First Out" (FIFO).  When units
  3. (or shares) are sold, there is a capital gain (or loss) on the sale.  FIFO
  4. uses the first shares purchased to compute the gain on the first sale.  The
  5. next sale uses the earliest purchased remaining un-sold shares to compute
  6. the gain for that sale and so on. For example:
  7.  
  8.   DATE    SHARES   AMOUNT
  9.  
  10.   2-2-89    300      750.00     Purchase 300 shares for $750.00
  11.   3-4-89    150      412.50     Purchase 150 shares for $412.50
  12.   9-9-89   -200     -600.00     Sell 200 shares for $600.00
  13.  
  14. The gain computed on FIFO uses the 300 shares purchased on 2-2-89 at a cost
  15. per share of $2.50 (750 / 300).  The cost of the 200 shares sold on 9-9-89
  16. was $500.00 (200 x 2.50).  The gain on the 9-9-89 sale is $100.00 (600-500).
  17. There are 100 shares of 2-2-89 purchase unsold.
  18.  
  19.  12-12-89  -200     -450.00     Sell 200 shares for $450.00
  20.  
  21. The gain on this sale uses the remaining 100 unsold shares of the 2-2-89
  22. purchase and 100 shares of the 3-4-89 purchase to compute the cost.
  23. The cost is (100 x 2.50) + (100 x 412.50/150) = $525.00.  The gain is thus
  24. 600.00-525.00 or $75.00.
  25.  
  26. The process is repeated for all sales to compute the gain for each sale.
  27.  
  28. This program does these tedious calculation for you.  The procedure trangain
  29. is called with 3 parameters.
  30.   macct   =   The account number of the investment to be analyzed
  31.   s_gain  =   The total gain for the account..returned to calling program
  32.   long    =   Is the account long.  Long means you own the shares
  33.               that are being sold, short (not long) means you are selling
  34.               shares you don't own.
  35.  
  36. The database file, transact.dbf has a minimum of 5 fields:
  37.  
  38.   DATE      Date of the transaction
  39.   ACCT      Account number (Charc) assingned to the investment
  40.   UNITS     Number of units (or shares) bought or sold in the transaction
  41.   AMOUNT    $ amount of the purchase (+) or sale (-)
  42.   GAIN      $ amount of the gain realized on the transaction.  This is
  43.               computed by the procedure trangain.
  44.  
  45. The database file is index on acct+DTOS(date) to order the transactions
  46. in chronological order by account.  I have included one account as an
  47. example.  It happens to be Fidelity Magellan Mutual Fund.
  48.  
  49. The way I use this procedure is every time I sell shares of an account,
  50. I first REPLACE date,acct,units and amount into transact.dbf.  If the units
  51. are less than 0, (a sale), I then call trangain to compute and enter the
  52. gain into that record.
  53.  
  54. Enjoy....Peare
  55.